<?php
namespace app\model;

use think\Model;

class Upload extends Model
{
    protected $append = ['type_text'];

    public function getTypeTextAttr($value, $data)
    {
        $array = [
            'local'     => '本地',
            'alioss'    => '阿里云OSS'
        ];

        return isset($data['type']) ? $array[$data['type']] : "";
    }
}